from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
src_file=raw_input("input source file name:")
fin = open(src_file, 'r')
code = fin.read()
lexer='';
if src_file.endswith('.java'):
    lexer = get_lexer_by_name("java", stripall=True)
else:
    lexer = get_lexer_by_name("cpp", stripall=True)
formatter = HtmlFormatter(linenos='inline', noclasses=True,lineseparator='<br/>')
result = highlight(code, lexer, formatter)

fout=open(src_file+'.txt','w');
fout.write(result)

